<?php if (!defined('SYSTEM_ROOT')) {
    die('Insufficient Permissions');
}
function callback_init()
{
    //cron setting
    option::add('tieba_serverchan_run_id', 0);
    option::add('tieba_serverchan_last_date', 0);
    option::add('tieba_serverchan_log', '无日志');
    //admin setting
    option::add('tieba_serverchan_default_open', 1);
    option::add('tieba_serverchan_send_hour', 1);
    option::add('tieba_serverchan_title', '贴吧云签到报告');
    option::add('tieba_serverchan_content', '<a href="[SYSTEM_URL]">[SYSTEM_NAME]</a>' . PHP_EOL . '[details]');
    //cron_tab setting
    cron::set('tieba_serverchan', 'plugins/tieba_serverchan/cron_tieba_serverchan.php', 0, '自定义签到报告微信推送定时任务', 0);
}

function callback_inactive()
{
    //cron_tab setting
    cron::del('tieba_serverchan');
}

function callback_remove()
{
    //cron setting
    option::del('tieba_serverchan_run_id');
    option::del('tieba_serverchan_last_date');
    option::del('tieba_serverchan_log');
    //admin setting
    option::del('tieba_serverchan_default_open');
    option::del('tieba_serverchan_send_hour');
    option::del('tieba_serverchan_title');
    option::del('tieba_serverchan_content');
    //user setting
    global $m;
    $m->query("DELETE FROM " . DB_PREFIX . "users_options WHERE NAME='tieba_serverchan_enable'");
}

?>